package com.casstime.ec.cloud.service.amountPromotion;

import java.util.List;
import java.util.Map;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.casstime.ec.cloud.spi.PagedModels;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotion;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotionBrandCategoryVO;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotionCompany;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotionFlowing;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotionFlowingRequest;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotionQueryRequest;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotionRequest;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotionUpdateRecord;
import com.casstime.ec.cloud.values.amountPromotion.OrderPromotionParam;
import com.casstime.ec.cloud.values.amountPromotion.OrderRequest;

/**
 * ClassName: DiscountService 
 * Function: (金额促销)
 * Reason: ADD REASON(可选).
 *  
 * @author wu.chen 
 * 2018年2月26日 上午10:59:31
 * @version   
 * @since JDK 1.8
 */
@FeignClient("discount-service")
public interface DiscountService {
	
	@RequestMapping(value = "/discount/fullcut/addOrUpdate", method = RequestMethod.POST)
	int addOrUpdateAmountPromotion(@RequestBody AmountPromotion amountPromotion,
			@RequestParam("userLoginId") String userLoginId,
			@RequestParam("companyId") String companyId) throws Exception;
	
	@RequestMapping(value = "/discount/fullcut/{promotionId}/stop", method = RequestMethod.GET)
	int stopAmountPromotion(@PathVariable("promotionId") String promotionId,
			@RequestParam("userLoginId") String userLoginId) throws Exception;

	@RequestMapping(value = "/discount/fullcut/{promotionId}/find", method = RequestMethod.GET)
	AmountPromotion findAmountPromotion(@PathVariable("promotionId") String promotionId) throws Exception;

	@RequestMapping(value = "/discount/record/{promotionId}", method = RequestMethod.GET)
	PagedModels<AmountPromotionUpdateRecord> listAmountPromotionRecordById(@PathVariable("promotionId") String promotionId,
														   @RequestParam("pageSize") Integer pageSize,
														   @RequestParam("pageNum") Integer pageNum) throws Exception;
	
	@RequestMapping(value = "/discount/multiQuery", method = RequestMethod.POST)
	Map<String, List<AmountPromotion>> queryDiscountPolicys(@RequestBody AmountPromotionQueryRequest queryRequest) throws Exception;
	
	@RequestMapping(value = "/discount/fullcut/{productStoreId}/list", method = RequestMethod.POST)
	PagedModels<AmountPromotion> listAmountPromotionStoreId(@PathVariable("productStoreId") String productStoreId,
														   @RequestParam("pageSize") Integer pageSize,
														   @RequestParam("pageNum") Integer pageNum,
														   @RequestBody AmountPromotionRequest request) throws Exception;
	
	
	@RequestMapping(value = "/discount/fullcut/orderQuery", method = RequestMethod.POST)
	Map<String, OrderPromotionParam> orderQueryDiscount(@RequestBody OrderRequest orderRequest) throws Exception;
    
	@RequestMapping(value = "/discount/fullcutFlowing/{productStoreId}/list", method = RequestMethod.POST)
	PagedModels<AmountPromotionFlowing> listAmountPromotionFlowStoreId(@PathVariable("productStoreId") String productStoreId,
														   @RequestParam("pageSize") Integer pageSize,
														   @RequestParam("pageNum") Integer pageNum,
														   @RequestBody AmountPromotionFlowingRequest request) throws Exception;
	
	@RequestMapping(value = "/discount/listAmountPromotionCompany/{productStoreId}/list", method = RequestMethod.GET)
	List<AmountPromotionCompany> listAmountPromotionCompanyBystoreId(@PathVariable("productStoreId") String productStoreId) throws Exception;
	
	/**
	 * validBrandAndCategory:(满减后台验证接口).<br/>  
	 * @throws Exception
	 * @author 徐彪
	 * @date 2018年3月24日 上午11:53:20
	 */
	@RequestMapping(value = "/discount/fullcut/validBrandAndCategory", method = RequestMethod.POST)
	List<Map<String, String>> validBrandAndCategory(@RequestBody AmountPromotionBrandCategoryVO vo) throws Exception;

}
